<div class="bjui-pageContent">
    <!-- 内容区 -->
    <form datagrids="userinfo" data-toggle="ajaxform">
        <label class="row-label">部门名称</label>
        <div class="row-input">
            <input type="text"  id="orgName">
        </div>
        <label class="row-label">所属科室</label>
        <div class="row-input">
            <input type="text"  id="upOrgName">
        </div>

        <label class="row-label">负责人</label>
        <div class="row-input"><input type="text" id="leader"></div>

        <label class="row-label">联系方式</label>
        <div class="row-input"><input type="text" id="leaderTel" ></div>
        <div class="text-center">
            <button type="submit" class="btn-default" onclick="add()">提交表单</button>
        </div>
    </form>
    <script>
        (function (){
            $('#orgName').val(deparment.deparmentData.orgName);
            $('#upOrgName').val(deparment.deparmentData.upOrgName);
            $('#leader').val(deparment.deparmentData.leader);
            $('#leaderTel').val(deparment.deparmentData.leaderTel);
        })();
        function add() {
            if ($('#orgName').val() == "" || $('#upOrg_name').val() == "" || $('#leader').val() == "" || $('#leaderTel').val() == "") {
                BJUI.alertmsg('info', '以上信息不能为空不能为空')
            } else {
                BJUI.ajax('doajax', {
                    url: URL + 'updateSmOrg.do',
                    data: {
                        orgId:deparment.deparmentData.orgId,
                        orgName: $('#orgName').val(),
                        upOrgName: $('#upOrgName').val(),
                        leader: $('#leader').val(),
                        leaderTel: $('#leaderTel').val(),
                    },
                    loadingmask: true,
                    okCallback: function (json, options) {
                        //刷新表格
                        $('#departTable').datagrid('refresh');
                    }
                });
            }
        }


    </script>

</div>
